Skip to content

Conversation

@emilykl
Copy link
Contributor

@emilykl emilykl commented Jan 6, 2026

Closes #7683

This PR slightly modifies the default tickmode logic, such that tickmode defaults to 'sync' rather than 'auto' for overlaying axes. Motivation is explained in the linked issue.

Note: One case is excluded: When the overlaying axis is categorical (or multicategory), tickmode continues to default to 'auto' rather than 'sync', as 'sync' causes unexpected behavior with categorical axes and is probably never intended by the user.

@emilykl emilykl force-pushed the shared-axis-lines-default branch from e7ee5b3 to 2be45e2 Compare January 7, 2026 21:29
@emilykl emilykl force-pushed the shared-axis-lines-default branch from cb1bf35 to c4c70fd Compare January 19, 2026 21:27
@emilykl emilykl force-pushed the shared-axis-lines-default branch from 7230cfb to 7d71516 Compare January 21, 2026 23:36
@emilykl emilykl requested a review from camdecoster January 21, 2026 23:56
Copy link
Contributor

@camdecoster camdecoster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I left a few small syntax suggestions, but it's good to go as is.

var axListIType = axListI[axisType];
if(!axListI.fixedrange && axListIType.tickmode === 'sync') activeAxIds.push(axListIType._id);
var axId = axListIType._id;
if(!axListI.fixedrange && axListIType.tickmode === 'sync' && activeAxIds.indexOf(axId) === -1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(!axListI.fixedrange && axListIType.tickmode === 'sync' && activeAxIds.indexOf(axId) === -1) {
if(!axListI.fixedrange && axListIType.tickmode === 'sync' && !activeAxIds.includes(axId)) {

'If *sync*, the number of ticks will sync with the overlayed axis',
'set by `overlaying` property.'
'set by `overlaying` property. When no other tick info is provided,',
'overlyaing (non-categorical) axes default to *sync*, while other axes default to *auto*.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'overlyaing (non-categorical) axes default to *sync*, while other axes default to *auto*.',
'overlaying (non-categorical) axes default to *sync*, while other axes default to *auto*.',

var isTypedArraySpec = require('../../lib/array').isTypedArraySpec;
var decodeTypedArraySpec = require('../../lib/array').decodeTypedArraySpec;

module.exports = function handleTickValueDefaults(containerIn, containerOut, coerce, axType, opts) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
module.exports = function handleTickValueDefaults(containerIn, containerOut, coerce, axType, opts) {
module.exports = function handleTickValueDefaults(containerIn, containerOut, coerce, axType, opts = {}) {


module.exports = function handleTickValueDefaults(containerIn, containerOut, coerce, axType, opts) {
if(!opts) opts = {};
if (!opts) opts = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!opts) opts = {};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default gridline behavior for overlaid axes is ugly and hard to read

3 participants